<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>咨询大厅</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">

		<!--标准mui.css-->
		<link rel="stylesheet" href="../../css/mui.min.css">
		<!--App自定义的css-->
		<link rel="stylesheet" type="text/css" href="../../css/app.css" />
		<style>
			* {
				border: 0px;
				padding: 0px;
				margin: 0px;
				font-family: "微软雅黑";
			}
		</style>
	</head>

	<body style="background-color: white; width: 100%;">
		<!--
        	作者：xuzhao_deng@sina.com
        	时间：2016-12-08
        	描述：咨询大厅
        -->
		<div class="mui-content" style="background-color: white;">
			<div style="display: flex; width: 100%; text-align: center; height: 30px; margin: 10px 0px 0px 0px; font-size: 16px;">
				<div style="width: 33%;">
					<span style="color: #303030;">推荐名师</span>
					<img src="../../img/hall/jiantou_03.png" width="10" height="8" />
				</div>
				<div style="margin: 2px 0px 0px 0px;">
					<hr style="width: 1px; height: 16px; background-color: #DCDCDC;" />
				</div>
				<div style="width: 33%;">
					<span style="color: #303030;">孩子年龄</span>
					<img src="../../img/hall/jiantou_03.png" width="10" height="8" />
				</div>
				<div style="margin: 2px 0px 0px 0px;">
					<hr style="width: 1px; height: 16px; background-color: #DCDCDC;" />
				</div>
				<div style="width: 33%;">
					<span style="color: #303030;">人气排名</span>
					<img src="../../img/hall/jiantou_03.png" width="10" height="8" />
				</div>
			</div>
			<div style="margin: 5px 0px 0px 0px;">
				<hr style="width: 100%; height: 1px; background-color: #DCDCDC;" />
			</div>
			<div id="pf-advisory" class="mui-scroll-wrapper" style="margin-top: 47px;">
				<div class="mui-scroll" style="background-color: white;">
					
					<!--<a style="color: black;">
					<div style="background-color: ghostwhite; width: 94%; margin: 0px 10px 10px 10px; height: 150px; display: flex;">
						<div style="float: left; width: 28%; margin: 20px 10px 10px 5px; text-align: center;">
							<img src="../../img/icon/zhuanjia.png" height="70" width="70" style="-moz-border-radius: 15px; -webkit-border-radius: 15px; border-radius:15px;" />
							<img src="../../img/hall/renzheng_03.png" style="margin: -15px 0px 0px 55px; display: block;" height="16" width="16" />
							<span style="display: block; font-size: 15px; text-align: center;">
								<span>国家二级</span>
								<span style="display: block;">心理咨询师</span>
							</span>
						</div>
						<div style="float: right; width: 70%; margin: 20px 0px 0px 10px;">
							<span style="font-size: 16px;">苏小妹</span>
							<span style="display: block; margin-top: 5px; font-size: 16px;">擅长方向：性格习惯、情绪人际、青春期、亲子关系</span>
							<span style="display: block; margin-top: 25px; font-size: 14px;">
								<span style="float: left;">咨询人次：100</span>
								<span style="float: right; margin-right: 5px;">咨询时长：100</span>
							</span>
						</div>
					</div>
					</a>-->
					
					<!--数据列表-->
					<div id="consultantLst">
						
					</div >
				</div>
			</div>
		</div>
		<script src="../../js/mui.min.js"></script>
		<script src="../../js/utils/http.utils.js"></script>
		<script>
			var $wxfwid = localStorage.getItem("wxfwid");
			var $currpage = 0;
			mui.init({
				pullRefresh: {
					container: "#pf-advisory",
					up: {
						height: 20,
						auto: true,
						deceleration: 0.0006 ,
						contentrefresh : "加载中...",
						contentnomore:'没有更多数据了',
						callback: loadadvLstDat
					}
				}
			});
			
			/**
			 * 上拉加载具体业务实现
			 */
			function fun_fur_advisory() {
				setTimeout(function() {
					fun_loadAdvisoryLst();
					//mui('#pf-advisory').pullRefresh().endPullupToRefresh(); 
				}, 400);
			}
			/*if (mui.os.plus) {
				mui.plusReady(function() {
					setTimeout(function() {
						mui('#pf-advisory').pullRefresh().pullupLoading();
					}, 400);

				});
			} else {
				mui.ready(function() {
					mui('#pf-advisory').pullRefresh().pullupLoading();
				});
			}*/
			
			function loadadvLstDat(){
				getAdvLstDat(5, $currpage);
			}
			
			function getAdvLstDat($psize, $cpage){
				mui.ajax({
					url : $request_url.getConsultantLst,
					type : "get",
					dataType : "json",
					headers: {
						"Authorization": $headers_authorization
					},
					data : {
						orgId : $wxfwid,
						rows : $psize,
						page : $cpage
					},
					success : function(dat){
						if(dat.code == 0){
							var $conArray = dat.result;
							if($conArray != null && $conArray != ""){
								$currpage ++;
								mui("#pf-advisory").pullRefresh().endPullupToRefresh(false);
								var $conDoc = document.getElementById("consultantLst");
								for(var i = 0; i < $conArray.length; i ++){
									var $conInfo = $conArray[i];
									var $conLi = document.createElement('div');
									$conLi.innerHTML = fun_advisoryLstTem($conInfo, i);
									$conDoc.appendChild($conLi);
								}
							} else {
								mui("#pf-advisory").pullRefresh().endPullupToRefresh(true);
							}
						} else {
							mui.toast(dat.message);
							return;
						}
					}, error : function(err){
						mui.toast("服务繁忙...");
						return;
					}
				});
			}
			
			function fun_advisoryLstTem($advisory, $num){
				var $certificate = $advisory.certificate + "";
				var $fixCer = $certificate.substr(0, 4);
				var $zhcer = $certificate.substr(4, 5);
				//href="adv-detailed.html?zjuid='+ $advisory.userid +'"
				var $advisoryTem = 
				
					'<a style="color: black;" href="adv-detailed.html?zjuid='+ $advisory.userId +'"><div style="background-color: #F9F9F9; width: 94%; margin: 0px 10px 10px 10px; height: 150px; display: flex;">'
					+	'<div style="float: left; width: 28%; margin: 20px 10px 10px 5px; text-align: center;">'
					+		'<img src="'+ $advisory.faceImage +'" height="70" width="70" style="-moz-border-radius: 15px; -webkit-border-radius: 15px; border-radius:15px;" />'
					+		'<img src="../../img/hall/renzheng_03.png" style="margin: -15px 0px 0px 70px; display: block;" height="16" width="16" />'
					+		'<span style="display: block; font-size: 15px; text-align: center; color:#909090;">'
					+			'<span>'+ $fixCer +'</span>'
					+			'<span style="display: block;">'+ $zhcer +'</span>'
					+		'</span>'
					+	'</div>'
					+	'<div style="float: right; width: 70%; margin: 20px 0px 0px 10px;">'
					+		'<span style="font-size: 16px; color:#303030;">'+ $advisory.trueName +'</span>'
					+		'<span style="display: block; margin-top: 5px; font-size: 15px; color:#616161;">擅长方向：'+ $advisory.speciality +'</span>'
					+		'<span style="display: block; margin-top: 25px; font-size: 12px;">'
					+			'<span style="float: left; color:#909090;">咨询人次：'+ $advisory.consultPersonNum +'人</span>'
					+			'<span style="float: right; margin-right: 5px; color:#909090;">咨询时长：'+ $advisory.consultHourNum +'小时</span>'
					+		'</span>'
					+	'</div>'
					+'</div></a>';
				return $advisoryTem;
			}
			
			mui('body').on("tap", "a", function(){
				mui.openWindow({
					url : this.href
				});
			});
			
		</script>
	</body>

</html>